﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Xml;
using VersionComparer.Images;
using VersionComparer.Base;
using VersionComparer.Comparer;

namespace VersionComparer.DataModel.Xml
{
    public class XmlTextItem : XmlItem
    {
        protected static Image elementImage = InitializeImage(ImageResources.Empty);
        public XmlTextItem()
        {
        }
        public XmlTextItem(ComparableItem parent, XmlNode node)
            : base(parent, node, node.InnerText)
        {
        }

        protected override System.Drawing.Image GetImage()
        {
            return elementImage;
        }
        protected override void BuildRtf(Base.RtfBuilder builder, bool differencesOnly, bool useParentColor)
        {
            if (Parent is XmlAttributeItem)
                builder.Append(XmlNode.InnerText, Color.Blue);
            else
                builder.Append(XmlNode.InnerText);
        }
        public override double Matches(ComparisonAlgorithm algorithm , ComparableItem other)
        {
            
            return Match.CertainMatch;
        }

    }
}
